﻿using System;
using System.Linq.Expressions;
using System.Threading;

namespace Objectware.Silverlight.Testing.TestProject
{
	public static class ServiceHelper
	{

		public static void ExecuteMethod(Expression<Action> expression)
		{
			Action actionToExecute = expression.Compile();
			for (var i = 0; i < 5; i++)
			{
				try
				{
					actionToExecute();
					break;
				}
				catch
				{
					Thread.Sleep(1000);
				}
			}

		}

	}
}
